import React from 'react';
import {Table, Row, Col, Form, Input, Icon, InputNumber, Radio, DatePicker, Select, Upload, Button, Switch, Modal, Popconfirm, Tabs, message} from 'antd';
import moment from 'moment'
import OperatorConstant from "../../utils/OperatorConstant";
import {downloadFile} from '../../utils/commons'

const R = require('ramda');
const TabPane = Tabs.TabPane;
const FormItem = Form.Item;
const dateFormat = 'YYYY-MM-DD';


export default Form.create({wrappedComponentRef: true})(class ApprovalList extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            disabled: true,
            type: "",
        }
    }



    columns = [
        {title: '付款水单', render(record) {
            return <a href="#" onClick={()=>downloadFile("order",record.url)}> {R.isNil(record.url) || R.isEmpty(record.url) ? "无" : record.filename}</a>
        }},
        {title: '审核人员', dataIndex: 'creatorName', key: 'creatorName'},
        {title: '审核意见', dataIndex: 'memo', key: 'memo'},
        {title: '付款状态', render(record) {
            if(record.status == '0') {
                return '失败';
            } else if(record.status === '1') {
                return '成功';
            }
        }},
        {title: '提交时间', dataIndex: 'creattime', key: 'creattime',width: '100px'},
    ];


    render() {
        let dataSource = R.isNil(this.props.dataSource) ? {} : this.props.dataSource;



        return (
            <div>
                <Table dataSource={this.props.capital.payList} columns={this.columns} bordered={true} size={'middle'} scroll={{ x: true}}/>
            </div>
        );
    }
})


